//
//  ByCoreLogSqlite3.m
//  beibei_ios
//
//  Created by pro on 16/6/16.
//  Copyright © 2016年 hebidu. All rights reserved.
//

#import "ByCoreLogSqlite3.h"

#import "FastCoder.h"
#import "ByCoreDataBase.h"

@implementation ByCoreLogSqlite3

/** 存储打印信息 */
+ (void)debugWithBase:(NSDictionary *)baseDic content:(id)content {
    
    NSString *func = baseDic[@"func"];
    NSInteger line = [baseDic[@"line"] integerValue];
    NSInteger time = [baseDic[@"time"] integerValue];
    NSData *content_data = [FastCoder dataWithRootObject:content];
    NSData *context_data = [FastCoder dataWithRootObject:baseDic[@"context"]];
    
    [ByCoreDataBase setLogWithFunc:func
                              line:line
                              time:time
                           content:content_data
                           context:context_data];
    
}

/** 查找时间大于所查时间的打印 */
+ (NSArray *)queryDebugAfterTime:(NSInteger)time {
    
    NSArray *logs = [ByCoreDataBase queryLogsAfterTime:time];
    return logs;
}
@end
